package model

const (
	Disaster = "disaster"
	High     = "high"
	Warning  = "warning"
	Problem  = "problem"
	Recover  = "recover"
)

// AlarmRequest 报警请求数据
//`json:"vps_cpu" xorm:"INT(11)"`
type AlarmRequest struct {
	ID        string `json:"id" xorm:"not null pk autoincr varchar(64)"` //uuid
	Time      string `json:"time" xorm:"varchar(32)"`
	Level     string `json:"level" xorm:"varchar(11)"`
	IP        string `json:"ip" xorm:"varchar(64)"`
	Item      string `json:"item" xorm:"varchar(64)"`
	Message   string `json:"message" xorm:"varchar(200)"`
	Recipient string `json:"recipient" xorm:"varchar(100)" `
	Category  string `json:"category" xorm:"varchar(64)"`
	Count     int    `json:"count" xorm:"varchar(64)"`
}

// Rule 告警频率规则
type Rule struct {
	Interval int    `json:"interval" xorm:"varchar(64)"` //时间间隔
	Option   string `json:"option"`                      //报警方式
	Distance int    `json:"distance"`                    //发送报警时间
	Count    int    `json:"count" xorm:"int(2)"`         //发送几次报警
	Flag     int    `json:"flag" xorm:"int(1)"`          //告警是否关闭
}

// Debounce 防抖动配置
type Debounce struct {
	TimeLimit int `json:"timelimit"`
	DayCount  int `json:"daycount"`
	Day       int `json:"day"`
}
